<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<script src="../lib/umd/single-spa.js"></script>
<body>
  <a href="#/app1">
    加载1
  </a>
  <a href="#/app2">
    加载2
  </a>
  <script>
    const {registerApplication,start} = singleSpa
debugger
    registerApplication('app1',
      async (props)=>{
        console.log('激活');
        return {
          bootstrap:async ()=>{
            console.log('bootstrap');
          },
          mount:async ()=>{
            console.log('mount');
          },
          unmount:async ()=>{
            console.log('unmount');
          },
        }
      },
      location => location.hash.startsWith('#/app1'),
      {
        props:{
          a:1
        }
      }
    )
    registerApplication('app2',
      async (props)=>{
        console.log('激活2');
        return {
          bootstrap:async ()=>{
            console.log('bootstrap2');
          },
          mount:async ()=>{
            console.log('mount2');
          },
          unmount:async ()=>{
            console.log('unmount2');
          },
        }
      },
      location => location.hash.startsWith('#/app2'),
      {
        props:{
          a:1
        }
      }
    )

    start()
  </script>
</body>
</html>